﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using System.Text.RegularExpressions;

namespace ExameRegister.Model
{
    
    
    public class Emp_BasicInfoRegister : DataEntity
    {
        public Emp_BasicInfoRegister()
        { }
        #region Model
        private int _id;
        private string _name;
        private string _cardno;
        private string _gender;
        private string _birthplace;
        private string _householdregister;
        private string _native;
        private string _political;
        private string _health;
        private DateTime? _workdate = DateTime.Now;
        private string _registerno;
        private string _organizationtype;
        private DateTime? _nowworkdate = DateTime.Now;
        private string _nativeplace;
        private string _marriage;
        private string _homeaddress;
        private string _phone;
        private string _empidentity;
        private DateTime? _partytime;
        private string _special;
        private string _technicalpositions;
        private string _personneltype;
        private DateTime? _registerdate;
        private DateTime? _birthday;
        private int? _orgid;
        private string _positionname;
        /// <summary>
        /// 
        /// </summary>
        
        public int ID
        {
            set { _id = value; }
            get { return _id; }
        }
        /// <summary>
        /// 姓名
        /// </summary>
        [Required(ErrorMessage = "姓名必填")]
        public string Name
        {
            set { _name = value; }
            get { return _name; }
        }
        /// <summary>
        /// 证件号码
        /// </summary>
        
        public string CardNo
        {
            set { _cardno = value; }
            get { return _cardno; }
        }
        /// <summary>
        /// 性别
        /// </summary>
        [Required(ErrorMessage = "性别必填")]
        public string Gender
        {
            set { this.Validate("Gender", value, this); _gender = value; }
            get
            {
               
                return _gender;
            }
        }
        /// <summary>
        /// 出生地
        /// </summary>
        //[Required(ErrorMessage = "籍贯必填")]
        public string BirthPlace
        {
            set { this.Validate("BirthPlace", value, this);
                _birthplace = value; }
            get
            {
                
                return _birthplace;
            }
        }
        /// <summary>
        /// 户籍所在地
        /// </summary>
        //[Required(ErrorMessage = "联系地址必填")]
        public string HouseholdRegister
        {
            set { this.Validate("HouseholdRegister", value, this); _householdregister = value; }
            get
            {
                
                return _householdregister;
            }
        }
        /// <summary>
        /// 民族
        /// </summary>
         [Required(ErrorMessage = "民族必填")]
        public string Native
        {
            set { this.Validate("Native", value, this); _native = value; }
            get
            {
                
                return _native;
            }
        }
        /// <summary>
        /// 政治面貌
        /// </summary>
         [Required(ErrorMessage = "政治面貌必填")]
        public string Political
        {
            set { this.Validate("Political", value, this); _political = value; }
            get
            {
                
                return _political;
            }
        }
        /// <summary>
        /// 健康状况
        /// </summary>
         [Required(ErrorMessage = "健康状况必填")]
        public string Health
        {
            set { this.Validate("Health", value, this); _health = value; }
            get
            {
                
                return _health;
            }
        }
        /// <summary>
        /// 参加工作日期
        /// </summary>
         [Required(ErrorMessage = "参加工作时间必填")]
        public DateTime? WorkDate
        {
            set { this.Validate("WorkDate",value, this); _workdate = value; }
            get
            {
                
                return _workdate;
            }
        }
        /// <summary>
        /// 公务员登记号
        /// </summary>
        //[Required(ErrorMessage = "联系地址必填")]
        public string RegisterNo
        {
            set { this.Validate("RegisterNo", value, this); _registerno = value; }
            get
            {
                
                return _registerno;
            }
        }
        /// <summary>
        /// 编制类型
        /// </summary>
        
        public string OrganizationType
        {
            set { this.Validate("OrganizationType", value, this); _organizationtype = value; }
            get
            {
                
                return _organizationtype;
            }
        }
        /// <summary>
        /// 进本单位年月
        /// </summary>
         [Required(ErrorMessage = "进本单位时间必填")]
        public DateTime? NowWorkDate
        {
            set
            {
                this.Validate("NowWorkDate", value, this);
                _nowworkdate = value;
            }
            get
            {
                return _nowworkdate;
            }
        }
        /// <summary>
        /// 籍贯
        /// </summary>
         [Required(ErrorMessage = "籍贯必填")]
        public string NativePlace
        {
            set
            {
                this.Validate("NativePlace", value, this);
                _nativeplace = value;
            }
            get
            {
                return _nativeplace;
            }
        }
        /// <summary>
        /// 婚姻状况
        /// </summary>
         //[Required(ErrorMessage = "婚姻状况必填")]
        public string Marriage
        {
            set
            {
                this.Validate("Marriage", value, this);
                _marriage = value;
            }
            get
            {
                return _marriage;
            }
        }
        /// <summary>
        /// 家庭住址
        /// </summary>
         [Required(ErrorMessage = "联系地址必填")]
        public string HomeAddress
        {
            set
            {
                _homeaddress = value;
                this.Validate("HomeAddress", value, this);                
            }
            get
            {
                return _homeaddress;
            }
        }
        /// <summary>
        /// 住宅电话
        /// </summary>
         [Required(ErrorMessage = "手机号码必填")]
         [RegularExpression(@"^[1]+[3,5]+\d{9}", ErrorMessage = "您输入的不是手机号码")]
        public string Phone
        {
            set
            {
                _phone = value;
                this.Validate("Phone", value, this);
                //if (!string.IsNullOrEmpty(value) && !Regex.IsMatch(value, @"^((\(\d{3}\))|(\d{3}\-))?13\d{9}|15[89]\d{8}$") && IsValidate)
                //    new Exception("您输入的不是手机号码");
               
                
            }
            get
            {
                return _phone;
            }
        }
        /// <summary>
        /// 个人身份
        /// </summary>
        
        public string EmpIdentity
        {
            set { _empidentity = value; }
            get { return _empidentity; }
        }
        /// <summary>
        /// 入党日期
        /// </summary>
        
        public DateTime? PartyTime
        {
            set { _partytime = value; }
            get { return _partytime; }
        }
        /// <summary>
        /// 专长
        /// </summary>
        
        public string Special
        {
            set { _special = value; }
            get { return _special; }
        }
        /// <summary>
        /// 专业技术职务
        /// </summary>
        
        public string TechnicalPositions
        {
            set { _technicalpositions = value; }
            get { return _technicalpositions; }
        }
        /// <summary>
        /// 人员类别
        /// </summary>
        
        public string PersonnelType
        {
            set { _personneltype = value; }
            get { return _personneltype; }
        }
        /// <summary>
        /// 公务员登记时间
        /// </summary>
        
        public DateTime? RegisterDate
        {
            set { _registerdate = value; }
            get { return _registerdate; }
        }
        /// <summary>
        /// 
        /// </summary>
         [Required(ErrorMessage = "出生日期必填")]
        public DateTime? Birthday
        {
            set
            {
                _birthday = value;
                this.Validate("Birthday", value, this);
                
            }
            get
            {
                return _birthday;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        
        public int? OrgID
        {
            set { _orgid = value; }
            get { return _orgid; }
        }
        /// <summary>
        /// 
        /// </summary>
        //[Required(ErrorMessage = "职位名称必填")]
        public string PositionName
        {
            set
            {
                _positionname = value;
                this.Validate("PositionName", value, this);
                
            }
            get
            {
                return _positionname;
            }
        }

        private string _WorkExperice;
        [Required(ErrorMessage = "工作简历必填")]
        public string WorkExperice
        {
            get
            {
                return _WorkExperice;
            }

            set
            {
                _WorkExperice = value;
                this.Validate("WorkExperice", value, this);
               
            }
        }

        private DateTime? _KaoHeTiem1;

        public DateTime? KaoHeTime1
        {
            get { return _KaoHeTiem1; }
            set
            {
                //this.Validate("HouseholdRegister");
                _KaoHeTiem1 = value;
            }
        }

        private DateTime? _KaoHeTiem2;

        public DateTime? KaoHeTime2
        {
            get { return _KaoHeTiem2; }
            set { _KaoHeTiem2 = value; }
        }

        private DateTime? _KaoHeTiem3;

        public DateTime? KaoHeTime3
        {
            get { return _KaoHeTiem3; }
            set { _KaoHeTiem3 = value; }
        }

        private string _KaoHeResult1;
        [Required(ErrorMessage = "考核结果必填")]
        public string KaoHeResult1
        {
            get { return _KaoHeResult1; }
            set
            {
                _KaoHeResult1 = value;
                this.Validate("KaoHeResult1", value, this);
                
            }
        }

        private string _KaoHeResult2;
        [Required(ErrorMessage = "考核结果必填")]
        public string KaoHeResult2
        {
            get { return _KaoHeResult2; }
            set
            {
                _KaoHeResult2 = value;
                this.Validate("KaoHeResult2", value, this);
               
            }
        }

        private string _KaoHeResult3;
        [Required(ErrorMessage = "考核结果必填")]
        public string KaoHeResult3
        {
            get { return _KaoHeResult3; }
            set
            {
                _KaoHeResult3 = value;
                this.Validate("KaoHeResult3", value, this);
               
            }
        }

        private string _Jiangcheng;
        [Required(ErrorMessage = "奖惩情况必填")]
        public string Jiangcheng
        {
            get { return _Jiangcheng; }
            set
            {
                _Jiangcheng = value;
                this.Validate("Jiangcheng", value, this);
                
            }
        }

        private string _Training;
        [Required(ErrorMessage = "培训情况必填")]
        public string Training
        {
            get { return _Training; }
            set
            {
                _Training = value;
                this.Validate("Training", value, this);
               
            }
        }

        private string _Fuli;

        public string Fuli
        {
            get { return _Fuli; }
            set { _Fuli = value; }
        }

        private string _Dsc;

        public string Dsc
        {
            get { return _Dsc; }
            set { _Dsc = value; }
        }

        private DateTime? _OKDate;

        [Required(ErrorMessage="任现职务时间")]
        public DateTime? OKDate
        {
            get { return _OKDate; }
            set
            {
                _OKDate = value;
                Validate("OKDate", value, this);
            }
        }

        private DateTime? _JobDate;
        [Required(ErrorMessage="任现职务层次时间")]
        public DateTime? JobDate
        {
            get { return _JobDate; }
            set
            {
                _JobDate = value;
                Validate("JobDate", value, this);
            }
        }

        private string _DutyLevel;

        [Required(ErrorMessage="现任职务层次")]
        public string DutyLevel
        {
            get { return _DutyLevel; }
            set
            {
                _DutyLevel = value;
                Validate("DutyLevel", value, this);
            }
        }

        private string _DutyAttribute;

        public string DutyAttribute
        {
            get { return _DutyAttribute; }
            set { _DutyAttribute = value; }
        }
        


        private string _FullEducationBg;

        public string FullEducationBg
        {
            get { return _FullEducationBg; }
            set { _FullEducationBg = value; }
        }


        private string _FullDegree;

        public string FullDegree
        {
            get { return _FullDegree; }
            set { _FullDegree = value; }
        }

        private string _FullSchoolAndMajor;

        public string FullSchoolAndMajor
        {
            get { return _FullSchoolAndMajor; }
            set { _FullSchoolAndMajor = value; }
        }

        private string _PartEducationBg;

        public string PartEducationBg
        {
            get { return _PartEducationBg; }
            set { _PartEducationBg = value; }
        }

        private string _PartDegree;

        public string PartDegree
        {
            get { return _PartDegree; }
            set { _PartDegree = value; }
        }

        private string _PartSchoolAndMajor;

        public string PartSchoolAndMajor
        {
            get { return _PartSchoolAndMajor; }
            set { _PartSchoolAndMajor = value; }
        }

        private string _LXDH;

        [Required(ErrorMessage = "联系电话必填")]
        public string LXDH
        {
            get { return _LXDH; }
            set
            {
                _LXDH = value;
                Validate("LXDH", value, this);
            }
        }

        private string _Email;
        [Required(ErrorMessage = "邮箱必填")]
        public string Email
        {
            get { return _Email; }
            set
            {
                _Email = value;
                Validate("Email", value, this);
            }
        }
        

        private string _CurrentJobAndPosition;
        //现工作单位及职务
        [Required(ErrorMessage = "现工作单位及职务")]
        public string CurrentJobAndPosition
        {
            get { return _CurrentJobAndPosition; }
            set
            {
                
                _CurrentJobAndPosition = value;
                Validate("CurrentJobAndPosition", value, this);
            }
        }

        private int _PositionID;

        public int PositionID
        {
            get { return _PositionID; }
            set { _PositionID = value; }
        }

        private int _EmpID;

        public int EmpID
        {
            get { return _EmpID; }
            set { _EmpID = value; }
        }

        private bool? _HasPhoto;
        
        public bool? HasPhoto
        {
            get { return _HasPhoto; }
            set { _HasPhoto = value; }
        }

        private string _PhotoName;
        
        public string PhotoName
        {
            get { return _PhotoName; }
            set { _PhotoName = value; }
        }

       
        
        #endregion Model


        //public event PropertyChangedEventHandler PropertyChanged;
        //public void Validate(string PropName, object value)
        //{
        //    if (PropertyChanged != null)
        //    {
        //        Validate(PropName, value);
        //        this.PropertyChanged(this, new PropertyChangedEventArgs(PropName));
        //    }
        //}
        //public virtual void Validate(string PropName, object value)
        //{            
        //    Validator.ValidateProperty(value, new ValidationContext(this, null, null) { MemberName = PropName });
        //    //OnPropertyChanged(PropName);
        //}
    }
}
